#ifndef DETECT_H_
#define DETECT_H_

#include"../lib_include/TcpServer.h"
#include"MySql.h"

class Detect
{
public:
	typedef std::vector<std::vector<netlib::string>> results;

	Detect(netlib::net::EventLoop* loop, const netlib::net::InetAddress& listenAddr);

	void start();

private:
	void onConnection(const netlib::net::TcpConnectionPtr& conn);

    void onMessage(const netlib::net::TcpConnectionPtr& conn,
                    netlib::net::Buffer* buf,
                    netlib::Timestamp time);

    void dosomething(netlib::string& msg);

    void dologin(const char* str, netlib::string& msg);

    void doregistered(const char* str, netlib::string& msg);

    void doquery(const char* str, netlib::string& msg);

	void dorefresh(const char* str, netlib::string& msg);

	void dopost(const char* str, netlib::string& msg);

	netlib::net::TcpServer _server;
	MySql sql;

}; // class Detect end;


#endif
